<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自动定位到对应的View文件</title>
</head>
<body onload="test(2,2)">
<form name="myform">
    用户名:<input type="text" name="userName" id="userName"><br/>
    爱好：<input type="checkbox" name="hobby" value="听音乐">听音乐
    <input type="checkbox" name="hobby" value="足球">足球
    <input type="checkbox" name="userName" value="旅游">旅游
    <input type="button" value="统计结果" onclick="count"><br/>
</form>
<script type="text/javascript">
    let sec = 3;
    function gotoBaidu() {
        if (sec >0){
        document.open();
        document.write(sec + "秒后跳转");
        sec--;
    }
    else{
        location.href = "https://www.baidu.com/";
    }
    }
    setInterval("gotoBaidu()",1000);
</script>
</body>
</html>